package cn.jiyun.controller;

import cn.jiyun.common.config.Result;
import cn.jiyun.entity.Yjjk;
import cn.jiyun.entity.Yjqj;
import cn.jiyun.service.YjjkService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/yjjk")
@CrossOrigin
public class YjjkController {

    @Autowired
    private YjjkService yjjkService;

    @RequestMapping("/findPage")
    public Result findPage(Integer pageNum, Integer pageSize, @RequestBody Yjjk yjjk){
       Page<Yjjk> page=yjjkService.findPage(pageNum,pageSize,yjjk);
       return Result.ok(page);
    }

    @RequestMapping("/findId")
    public Result findId(Integer id) {
        Yjjk yjjk=yjjkService.findId(id);
        return Result.ok(yjjk);
    }
}
